<?php if (count($coupons)): ?>
<?php foreach ($coupons as $coupon):
if (is_array($shops)) {
    $shop = $shops[$coupon->shop_id];
} else {
    $shop = $shops->as_array();    
} ?> 
<div class="entry row">    
    <div class="span2">
        <div class="bthumb2">
            <span class="hlink" hlink="<?=Helper_Index::go_coupon_url($coupon) ?>" target="_blank"><img src="<?=$coupon->logo ?>" /></span>
        </div>
    </div>
 
    <div class="span7">
        <h4><span class="hlink" hlink="<?=Helper_Index::go_coupon_url($coupon) ?>" target="_blank"><?=$coupon->name ?></span></h4>
        
        <div class="button">
            <span class="hlink" hlink="<?=Helper_Index::go_coupon_url($coupon) ?>" target="_blank">Воспользоваться купоном</span>
        </div>

        <?php
        $date = new DateTime($coupon->end_date); ?>
        <p>Действителен до <?=$date->format('d.m.Y') ?></p>

        <div class="clearfix"></div>
    </div>
</div>      
<div class="clearfix"></div>
<?php endforeach; ?>
<?php else: ?>
<div class="span9"> 
    <p>К сожалению, в данной категории пока нет купонов.</p>
</div>
<?php endif; ?>